import moment from 'moment'
import dyrequest from "@Utils/request"

// 新增优惠券
export const addCouponData = (data) => {
    // console.log('data', data)
    return dyrequest({
        url: `marketing/coupons/v1/shopcoupons`,
        method: "post",
        data,
        paramete: {
            _bid: 'ecom_market_shop'
        }
    })
}
// 作废优惠券
export const stopCouponData = (id, data) => {
    // console.log('data', data)
    return dyrequest({
        url: `marketing/coupons/v1/shopcoupons/${id}`,
        method: "post",
        data,
        paramete: {
            _bid: 'ecom_market_shop'
        }
    })
}

// 获取推荐搜索词
export const getSetCouponGoodsList = (data) => {
    return dyrequest({
        url: `marketing/activity/v1/query_available_product_v2`,
        method: "post",
        data: {
            "page": data.page,
            "pageSize": data.pageSize,
            "activityToolType": 7,
            "start_time": data.start_time,
            "end_time": data.end_time,
            "activitySubType": {
                "coupon_sub_type": 1
            }
        },
        paramete: {
            _bid: 'ecom_market_shop'
        }
    })
}